// This is the main DLL file.

#include "stdafx.h"
#include "RenderLib.h"

namespace RenderLib {

Renderer::Renderer( Control^ inControl ) :
	m_RenderArea( nullptr ),
	m_DisplayControl( nullptr )
{
	m_DisplayControl = inControl;

	m_RenderArea = new CRenderArea( );
	HWND theWindowHandle = reinterpret_cast< HWND >( m_DisplayControl->Handle.ToPointer( ) );
	m_RenderArea->Initialize( theWindowHandle );
}

Renderer::~Renderer( )
{
	m_RenderArea->Destroy( );
	delete m_RenderArea;
	m_RenderArea = nullptr;

	m_DisplayControl = nullptr;
}

void Renderer::Render( )
{
	while( true )
		m_RenderArea->Render( );
}

}